package b2.widget
{
	import flash.display.Sprite;
	import flash.text.*;

	public class BasicMessage extends Sprite
	{
		public function BasicMessage(text:String, roundRecColor:uint = 0x60442B, txtColor:uint = 0x000000, width:int = -1)
		{
			super();
			var roundRecContainer:Sprite = new Sprite();
			//加载文字
			var titleText:TextField = new TextField();
			titleText.selectable = false;
        	titleText.autoSize = TextFieldAutoSize.LEFT;
			titleText.defaultTextFormat = new TextFormat("微软雅黑", 13, txtColor, true);
			titleText.multiline = true;
			if (width > 0)
			{
				titleText.wordWrap = true;
				titleText.width = width;
			}
			titleText.htmlText = text;
			roundRecContainer.addChild(titleText);
			//加载背景
			var roundRec:RoundRec = new RoundRec(roundRecContainer.width + 20, roundRecContainer.height + 20, 0.8, roundRecColor);
			roundRecContainer.x = 10;
			roundRecContainer.y = 10;
			addChild(roundRec);
			addChild(roundRecContainer);
		}
	}
}